package com.diapoclic.servlet;

import java.io.IOException;

import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.diapoclic.*;
import com.diapoclic.entity.User;

/**
 * Servlet implementation class TestServlet
 */
public class TestServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public TestServlet() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		
        PrintWriter out = response.getWriter();
        out.println("<html>");
        out.println("    <head><title>Simple servlet de test </title></head>");
        out.println("    <body>");
     
        
        // A CONTINUER!!!!!  
        User bob = new  User();		
        out.println("    <h2> Je change le Login </h2>");

        bob.setLogin("Bob");
        out.println("    <h2> Je change l'adresse mail </h2>");

		bob.setMail("aaa@bbb.fr");
		
        out.println("    <h2> J'ai tout finiiiiii !!!</h2>");
        out.println("    </body>");
        out.println("</html>");
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}

}
